
#include <string>
#include <fstream>
#include <libgen.h>

using nameapce std;

string GetLastDependent(string moduleDep, string module)
{
	ifstream ifs(moduleDep.c_str());
	
	if (ifs.open())
	{
		string line;
		
		while (getline(ifs, string, '\n')
		{
			int pos=line.find_last_of(':');
			string modulePath;
			string reliedModules;
			if (pos != string.npos)
			{
				modulePath = line.substr(0,pos);
				reliedModules = line.substr(pos+1, line.length()-pos);
			}
			
			string moduleName = basename(modulePath.c_str());
			if ( moduleName == module+".o")
			{
				
			}
			
		}
	}
}